package com.mathassistant.client.event.exercise;

import com.google.gwt.event.shared.GwtEvent;
import com.mathassistant.shared.TopicDTO;

public class ExerciseAddEvent extends GwtEvent<ExerciseAddEventHandler>{

	public static final Type<ExerciseAddEventHandler> TYPE = new Type<ExerciseAddEventHandler>();
	private TopicDTO topic;
	private int indexCurBeginList = 0;
	
	public ExerciseAddEvent(TopicDTO topic){
		this.topic = topic;
	}
	
	public ExerciseAddEvent(TopicDTO topic , int indexCurBeginList){
		this.topic = topic;
		this.indexCurBeginList = indexCurBeginList;
	}
	
	public TopicDTO getTopic(){
		return topic;
	}
	
	public int getIndexCurBeginList(){
		return indexCurBeginList;
	}
	
	public void setIndexCurBeginList(int indexCurEx){
		this.indexCurBeginList = indexCurEx;
	}
	
	@Override
	public Type<ExerciseAddEventHandler> getAssociatedType() {
		// TODO Auto-generated method stub
		return TYPE;
	}

	@Override
	protected void dispatch(ExerciseAddEventHandler handler) {
		// TODO Auto-generated method stub
		handler.onAddExercise(this);
	}

}
